import {defineConfig} from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import {join} from 'path'

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [uni()],
    resolve: {
        alias: {
            '@': join(__dirname, './src')
        }
    },
    server: {
        port: 9001,
        proxy: {
            '/api': {
                target: 'http://127.0.0.1:8088',
                timeout: 5000,
                rewrite: path => path.replace(/^\/api/, ''),
            },
            "/png": {
                target: 'http://127.0.0.1:8080',
                timeout: 5000,
                rewrite: path => path.replace(/^\/png/, ''),
            }
        }
    }
});
